#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    int searchInsert(vector<int> &nums, int target)
    {
        int left = 0;
        int right = nums.size() - 1;
        int ans = right;
        while (left <= right)
        {
            int mid = (left + right) / 2;
            if (nums[mid] >= target)
            {
                ans = mid;
                right = mid - 1;
            }
            else
                left = mid + 1;
        }
        return ans;
    }
};

int main()
{
    cout << "Code35" << endl;
    Solution s;
    cout << s.searchInsert(std::vector<int>{1, 3, 5, 6}, 5) << endl;
    return 0;
}